/**
 * 载入项目引导文件
 */
require('./bootstrap');

window.Vue = require('vue');

//时间控件，官网：https://github.com/weifeiyue/vue-datepicker-local
import VueDatepickerLocal from 'vue-datepicker-local'

const app = new Vue({
    el: '#wrapper',
    data:{
        table:null,
        searchParams:{
            card_base_id:0,
            start_time:'',
            end_time:''
        },
        start_time:'',
        end_time:'',
        box:null,
        member_card:page_params.data_member_card,
        count_data:[],
    },
    watch:{
        searchParams:{
            handler: function (val) {
                //this.query();
            },
            deep: true
        },
        start_time:function (val) {
            var d = new Date(val);
            let format = d.getFullYear() + '-' + (d.getMonth() + 1) + '-' + d.getDate() + ' ' + d.getHours() + ':' + d.getMinutes() + ':' + d.getSeconds();
            this.searchParams.start_time = format;
        },
        end_time:function (val) {
            var d = new Date(val);
            let format = d.getFullYear() + '-' + (d.getMonth() + 1) + '-' + d.getDate() + ' ' + d.getHours() + ':' + d.getMinutes() + ':' + d.getSeconds();
            this.searchParams.end_time = format;
        }
    },
    mounted:function(){

    },
    methods: {
        query: function () {
            utils.ajaxGet(page_params.url_list, this.searchParams, (response, params) => {
                if (response.data.status == 'success'){
                    this.count_data = response.data.data;
                }
                utils.showToastr(response.data);
            });
        },
    },
    components: {
        VueDatepickerLocal
    },
});